<?php

$rows = array( array('材料编号','材料名称','品牌','规格','单位',
		'入库数量', '单价', '金额', '出库数量', '单价', '金额', '结存数量', '单价', '金额', ) );
if($list) foreach($list as $ware){
	$tmp = array($ware['sno'], $ware['name'], $ware['brand'], $ware['specific'], $ware['unit'],);
	if($ware['class']=='in'){
		$tmp = array_merge($tmp, array($ware['amount'], fnum($ware['price']), fnum($ware['amount']*$ware['price']), '','',''));
	}
	else{
		$tmp = array_merge($tmp, array('','','', $ware['amount'], fnum($ware['price']), fnum($ware['amount']*$ware['price'])));
	}
	$tmp = array_merge($tmp, array($ware['bl_amount'], fnum($ware['bl_price']), fnum($ware['bl_total']), $ware['remark']));
	$rows[] = $tmp;
}
Exporter::csv($rows, '库存明细');

?>
